package com.zhou.framework.quartz.service;

import com.zhou.framework.quartz.dto.JobPageDto;
import com.zhou.framework.quartz.dto.QuartzQueryDto;
import com.zhou.framework.quartz.model.JobConfig;
import org.apache.ibatis.annotations.Param;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;

import java.util.List;

public interface QuartzService {
    List<JobPageDto> getPageList(QuartzQueryDto dto);
    //PageInfo<Map<String,Object>> getLogPageList(PageParam2 pageParam, String name);
    int resetTriggerStatus(String prefix);
    void createJob(JobConfig config) throws SchedulerException;
    void update(JobConfig config) throws SchedulerException;

    /**
     * 启动服务
     */
    void start() throws SchedulerException;
    void reLoad() throws Exception;
    JobConfig getJobByJobName(String jobName) throws SchedulerException;

    /**
     * 停止服务
     */
    void stop() throws SchedulerException;

    /**
     * 暂停定时任务
     */
    void pauseJob(JobConfig config) throws SchedulerException;

    /**
     * 启动/恢复 定时任务
     */
    void startJob(JobConfig config) throws SchedulerException;
    void deleteJob(JobConfig config) throws SchedulerException;

    int updateQuartzLogError();

    Scheduler getScheduler();
}
